var week=["全周","星期一","星期二","星期三","星期四","星期五","星期六","星期日"];
var weekday = [];
weekday[1] = [
    {name:"web技术",day:"星期一",time:"1-2",place:"图东教学楼219",teacher:"刘猛"},
    {name:"人机交互技术",day:"星期一",time:"3-4",place:"商学院256",teacher:"卞玉龙、郭娜、王春鹏"},
    {name:"计算机游戏开发技术",day:"星期一",time:"5-6",place:"电子楼404",teacher:"黄文高"},
    {name:"数字图像处理实验",day:"星期一",time:"7-8",place:"知行南楼505/507",teacher:"张亚涛"},
    {name:"web实验",day:"星期一",time:"9-10",place:"知行南楼505/507",teacher:"刘猛"}
    ];
weekday[2] = [
    {name:"web技术",day:"星期二",time:"1-2",place:"图东教学楼219",teacher:"刘猛"},
    {name:"机器学习",day:"星期二",time:"3-4",place:"图东教学楼208",teacher:"金长龙"},
    {name:"美术基础",day:"星期二",time:"5-8",place:"知行南楼508",teacher:"李婷"},
];
weekday[3] = [
    {name:"数字图像处理",day:"星期三",time:"3-4",place:"图西教学楼105",teacher:"张亚涛"},
    {name:"影视编导",day:"星期三",time:"5-8",place:"图西环212",teacher:"刘娟"},
    {name:"外国文学名作欣赏",day:"星期三",time:"9-10",place:"图西教学楼108",teacher:"仵从巨"},
];
weekday[4] = [
    {name:"计算机网络",day:"星期四",time:"1-2",place:"图西环212",teacher:"程杰"},
    {name:"机器学习",day:"星期四",time:"3-4",place:"图东教学楼205",teacher:"金长龙"},
    {name:"习近平新时代中国特色社会主义思想概论",day:"星期四",time:"5-8",place:"腾讯会议",teacher:"焦佩"},
    {name:"计算机网络实验",day:"星期四",time:"9-10",place:"知行南楼506",teacher:"程杰"},
];
weekday[5] = [
    {name:"计算机网络",day:"星期五",time:"3-4",place:"图西环316",teacher:"程杰"},
    {name:"数字图像处理",day:"星期五",time:"5-6",place:"图西教学楼105",teacher:"张亚涛"},
    {name:"机器学习实验",day:"星期五",time:"9-10",place:"知行南楼",teacher:"金长龙"},
];
weekday[6] = [
    {name:"创新设计导航",day:"星期六",time:"9-10",place:"智慧树",teacher:"金长龙/王春鹏"},
]
weekday[7] = [
    {name:"人机交互实验",day:"星期日",time:"5-8",place:"知行南楼",teacher:"王春鹏"},
    {name:"思辨与创新",day:"星期日",time:"9-10",place:"智慧树",teacher:"熊浩"},
]
var id ="0"
function showcourse(index){
    document.getElementById(id).className = "day"


    document.getElementById(index).className ="dayseleted";
    id = index;
    index = Number(index);
    console.log(index);
    if(index){
        var coursetab = "<div>";
        coursetab = coursetab +"<div class='courseline'>"+
            "<div class = \"name\">课程名</div>" +
            // "<div class = \"day\"></div>" +
            "<div class = \"time\">节次</div>" +
            "<div class = \"place\">教室</div>" +
            "<div class = \"teacher\">教师</div>"+
            "</div>"
        for(var i=0;i < weekday[index].length;i++){
            coursetab = coursetab +"<div class='courseline'>"+
                "<div class = \"name\">"+ weekday[index][i].name + "</div>" +
                // "<div class = \"day\">"+ weekday[index][i].day + "</div>" +
                "<div class = \"time\">"+ weekday[index][i].time + "</div>" +
                "<div class = \"place\">"+ weekday[index][i].place + "</div>" +
                "<div class = \"teacher\">"+ weekday[index][i].teacher + "</div>"+
                "</div>"

        }
        coursetab = coursetab +"</div>";
    }
    else{
        var coursetab = "<div>";
        coursetab = coursetab +"<div class='courseline'>"+
            "<div class = \"name\">课程名</div>" +
             "<div class = \"weekday\">星期</div>" +
            "<div class = \"time\">节次</div>" +
            "<div class = \"place\">教室</div>" +
            "<div class = \"teacher\">教师</div>"+
            "</div>";
        for(var j=1;j<8;j++){
            index = j;
            for(var i=0;i < weekday[index].length;i++){
                coursetab = coursetab +"<div class='courseline'>"+
                    "<div class = \"name\">"+ weekday[index][i].name + "</div>" +
                    "<div class = \"weekday\">"+ weekday[index][i].day + "</div>" +
                    "<div class = \"time\">"+ weekday[index][i].time + "</div>" +
                    "<div class = \"place\">"+ weekday[index][i].place + "</div>" +
                    "<div class = \"teacher\">"+ weekday[index][i].teacher + "</div>"+
                    "</div>"
            }
        coursetab = coursetab +"</div>";

        }
    }

    document.getElementById("right").innerHTML = coursetab

}


